package com.xyz.jucTest;

interface Foo{
    public int sayHello(int x);

    default int div(int x,int y){
        return x/y;
    }
    public static int dv(int x,int y){
        return x * y;
    }
}

/**
 * @author 肖咉卓
 *  Lambda 表达式
 */
public class LambdaExpressDemo {
    public static void main(String[] args) {
        //普通写法
        /*Foo foo=new Foo() {
            @Override
            public void sayHello() {
                System.out.println("hello java0222");
            }
        };
        foo.sayHello();*/

        //lambda 写法
        Foo foo=(int x) -> {System.out.println("hello java0222"+x); return 20;};
        System.out.println(foo.sayHello(10));
        System.out.println(foo.div(10,5));
        System.out.println(Foo.dv(10,4));
    }
}
